package org.zfes.snowier.zbss.xzy.router.zmd;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.zbss.xzy.biz.zmd.model.ModataSys;
import org.zfes.snowier.zbss.xzy.biz.zmd.service.IModataSysService;
import org.zfes.snowier.core.data.SelectVo;
@Controller 
@RequestMapping("/xzy")
public class ModataSysController implements BaseController {

	
	@Autowired
	private IModataSysService modataSysService;
	
	//@RequiresPermissions(value="modataSys:loadModataSysDataSet",desc="监控系统信息列表")
    @RequestMapping(value="/loadModataSysDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object loadModataSysDataSet(@RequestBody Map<String,Object> params){
	    DataSet dataSet=  modataSysService.loadModataSysDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
	//@RequiresPermissions(value="modataSys:createModataSys",desc="监控系统信息添加")
    @RequestMapping(value="/createModataSys", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public  @ResponseBody Object createModataSys(@RequestBody ModataSys modataSys){
		modataSysService.createModataSys(modataSys);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
	//@RequiresPermissions(value="modataSys:loadModataSys",desc="监控系统信息加载")
    @RequestMapping(value="/loadModataSys/{id}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object loadModataSys(@PathVariable("id")Long id){
		Optional<ModataSys> ops = modataSysService.loadModataSysById(id);
		return ajaxQuery("modataSys",ops);
    }
	
	//@RequiresPermissions(value="modataSys:updateModataSys",desc="监控系统信息更新")
    @RequestMapping(value="/updateModataSys", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object updateModataSys(@RequestBody  ModataSys modataSys){
		modataSysService.updateModataSys(modataSys);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	//@RequiresPermissions(value="modataSys:deletModataSys",desc="监控系统信息删除")
    @RequestMapping(value="/deleteModataSys/{id}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object deleteModataSys(@PathVariable("id")Long id){
		modataSysService.deleteModataSys(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }


    @RequestMapping(value="/loadModataSysSelectVo", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object loadModataSysSelectVo(){
		 List<SelectVo>  ops = modataSysService.loadModataSysSelectVo("");
		return ajaxQuery("selectVo",ops);
    }
    
}